<!DOCTYPE html>
<html>
{include file="public:header"}

<body class="no-skin">
<!--头部-->
{include file="public:nav"}

<div class="main-container ace-save-state" id="main-container">
  <!--菜单-->
  <script type="text/javascript">
  try{ace.settings.loadState('main-container')}catch(e){}
</script>

{include file="public:left"}

  <div class="main-content">
    <div class="main-content-inner">
      <div class="breadcrumbs ace-save-state" id="breadcrumbs">
        <ul class="breadcrumb">
          <li>
            <i class="ace-icon fa fa-home home-icon"></i>
            <a href="{:url('Index/index')}">首页</a>
          </li>
          <li class="active">添加产品</li>
        </ul><!-- /.breadcrumb -->

      </div>

      <div class="page-content">

        {include file="public:set"}

        <div class="row">
          <div class="col-xs-12">
            <div class="col-sm-10 col-sm-offset-1">
              <form id="logoForm" class="form-horizontal" action="__URL__/save" method="post" enctype="multipart/form-data">
                <div class="row">
                  <div class="col-sm-7">
                    <div class="widget-box transparent">
                      <div class="widget-header widget-header-flat">
                        <h4 class="widget-title"><i class="ace-icon fa fa-leaf green"></i>产品信息</h4>
                      </div>
                      <div class="widget-body">
                        <div class="widget-main">
                         
                          <div class="form-group">
                              <label class="col-sm-2 control-label no-padding-right" for="">所属分类</label>
                            <div class="col-sm-10">
                              <select class="form-control" name="fid" >
                                {volist name="res" id="v"}
                                <option value="{$v.ty_id}">{$v.ty_name}</option>
                               {/volist}
                              </select>
                            </div> 

                          </div>
                          
                           <div class="form-group">
                            <label class="col-sm-2 control-label no-padding-right" for="">标题</label>
                            <div class="col-sm-10">
                              <input class="form-control" type="text" name="title" required>
                            </div>
                          </div>
                          
                          <div class="form-group">
                            <label class="col-sm-2 control-label no-padding-right" for="">英文标题</label>
                            <div class="col-sm-10">
                              <input class="form-control" type="text" name="etitle" required>
                            </div>
                          </div>
                        
                           <div class="form-group">
                            <label class="col-sm-2 control-label no-padding-right" for="">关键词</label>
                            <div class="col-sm-10">
                              <input class="form-control" type="text" name="key">
                            </div>
                          </div>
                         
                          <div class="form-group">
                            <label class="col-sm-2 control-label no-padding-right" for="">发布者</label>
                            <div class="col-sm-10">
                              <input class="form-control" type="text" name="writer" required>
                            </div>
                          </div>
      
                        </div>
                      </div>
                    </div>
                  </div>
                  <div class="col-sm-5">
                    <div class="widget-box transparent">
                      <div class="widget-header widget-header-flat">
                        <h4 class="widget-title"><i class="ace-icon fa fa-leaf green"></i>图片</h4>
                      </div>
                      <div class="widget-body">
                        <div class="widget-main">
                          <div class="form-group">
                            <div class="col-xs-12">
                              <input multiple="" type="file" id="thumb" name="image"/>
                            </div>
                          
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
               
                <div class="row">
                  <div class="col-sm-12">
                    <script src="__ADMIN__/assets/js/ueditor.config.js" type="text/javascript"></script>
                    <script src="__ADMIN__/assets/js/ueditor.all.js" type="text/javascript"></script>
                    <textarea id="myEditor" name="content" style="width:100%;"></textarea>
                    <script type="text/javascript">
                      var editor = new UE.ui.Editor({
                        initialFrameHeight: 300
                      });
                      editor.render("myEditor");
                    </script>
                  </div>
                </div>
                <div class="clearfix form-actions">
                  <div class="col-md-offset-3 col-md-9">
                    <button class="btn btn-info" type="submit">
                      <i class="ace-icon fa fa-floppy-o bigger-110"></i>
                      保存
                    </button>
                    <button class="btn" type="reset">
                      <i class="ace-icon fa fa-undo bigger-110"></i>
                      重置
                    </button>
                  </div>
                </div>
              </form>
              <!-- PAGE CONTENT BEGINS -->
            </div>
            <!-- PAGE CONTENT ENDS -->
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.page-content -->
    </div>
  </div><!-- /.main-content -->

  <div class="footer">
  <div class="footer-inner">
    <div class="footer-content">
						<span class="bigger-110">
							<span class="blue bolder">Ace</span>
							朵朵科技CMS &copy; 2018-2020
						</span>

      &nbsp; &nbsp;
      <a href="http://www.dd371.com" target="_blank">技术支持: 朵朵科技</a>
 
    </div>
  </div>
</div>

<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
  <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
</a>
</div><!-- /.main-container -->


<script>
  jQuery(function($) {
    $('[data-rel=tooltip]').tooltip();

    $( "#hide-option" ).tooltip({
      hide: {
        effect: "explode",
        delay: 250
      }
    });

  })
</script>


  <script>
    $(function () {
      $('#thumb').ace_file_input({
        style: 'well',
        btn_choose: '缩略图',
        btn_change: null,
        no_icon: 'ace-icon fa fa-picture-o',
        droppable: true,
        thumbnail: 'fit'//large | fit
        //,icon_remove:null//set null, to hide remove/reset button
        /**,before_change:function(files, dropped) {
						//Check an example below
						//or examples/file-upload.html
						return true;
					}*/
        /**,before_remove : function() {
						return true;
					}*/
        ,
        preview_error: function (filename, error_code) {
          //name of the file that failed
          //error_code values
          //1 = 'FILE_LOAD_FAILED',
          //2 = 'IMAGE_LOAD_FAILED',
          //3 = 'THUMBNAIL_FAILED'
          //alert(error_code);
        }

      }).on('change', function () {
        //console.log($(this).data('ace_input_files'));
        //console.log($(this).data('ace_input_method'));
      });
      
      $('#thumbs').ace_file_input({
          style: 'well',
          btn_choose: '封面图',
          btn_change: null,
          no_icon: 'ace-icon fa fa-picture-o',
          droppable: true,
          thumbnail: 'fit'//large | fit
          //,icon_remove:null//set null, to hide remove/reset button
          /**,before_change:function(files, dropped) {
  						//Check an example below
  						//or examples/file-upload.html
  						return true;
  					}*/
          /**,before_remove : function() {
  						return true;
  					}*/
          ,
          preview_error: function (filename, error_code) {
            //name of the file that failed
            //error_code values
            //1 = 'FILE_LOAD_FAILED',
            //2 = 'IMAGE_LOAD_FAILED',
            //3 = 'THUMBNAIL_FAILED'
            //alert(error_code);
          }

        }).on('change', function () {
          //console.log($(this).data('ace_input_files'));
          //console.log($(this).data('ace_input_method'));
        });
      
      $('#thumbb').ace_file_input({
          style: 'well',
          btn_choose: '详情banner图',
          btn_change: null,
          no_icon: 'ace-icon fa fa-picture-o',
          droppable: true,
          thumbnail: 'fit'//large | fit
          //,icon_remove:null//set null, to hide remove/reset button
          /**,before_change:function(files, dropped) {
  						//Check an example below
  						//or examples/file-upload.html
  						return true;
  					}*/
          /**,before_remove : function() {
  						return true;
  					}*/
          ,
          preview_error: function (filename, error_code) {
            //name of the file that failed
            //error_code values
            //1 = 'FILE_LOAD_FAILED',
            //2 = 'IMAGE_LOAD_FAILED',
            //3 = 'THUMBNAIL_FAILED'
            //alert(error_code);
          }

        }).on('change', function () {
          //console.log($(this).data('ace_input_files'));
          //console.log($(this).data('ace_input_method'));
        });

      $("#article").ajaxForm({
        // url: 'links.html',
        // type: 'post',
        // success: fun
      })
    });

    //响应请求回调
    function fun() {

    }

  </script>
  <script>
$(function(){
	$('#logoForm').ajaxForm({
		beforeSubmit: checkForm, // 此方法主要是提交前执行的方法，根据需要设置
		success: complete, // 这是提交后的方法
		dataType: 'json'
	});
	
	function checkForm(){
	  
		
    }

	function complete(data){
		if(data.status==1){
			layer.alert(data.msg, {icon: 5}, function(index){
 			layer.close(index);
 			window.location.href=data.url;
			});
			
		}else{
			layer.alert(data.msg, {icon: 6}, function(index){
 			layer.close(index);
 			window.location.href=data.url;
			});
			
		}
	}
 
});

</script>
</body>
</html>
